package com.zcx.test.service.impl;

import com.zcx.test.common.vo.UserQuery;
import com.zcx.test.mapper.UserMapper;
import com.zcx.test.pojo.User;
import com.zcx.test.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author zhaochangxin
 * @date 2022/3/2 14:34
 */

// 加入Service层
@Service
public class UserServiceImpl implements UserService {
    // 自动注入UserMapper
    @Autowired
    UserMapper userMapper;

    //用户登陆方法
    @Override
    public User userLogin(User user) {
        return userMapper.userLogin(user);
    }

    @Override
    public User queryUserById(String id) {
        return userMapper.queryUserById(id);
    }

    @Override
    public void userRegister(User user) {
        userMapper.userRegister(user);
    }

    @Override
    public void updatePassword(User user) {
        userMapper.updatePassword(user);
    }

    @Override
    public List<User> queryUserList(UserQuery param) {
        return userMapper.queryUserList(param);
    }

    @Override
    public Long countUserList(UserQuery param) {
        return userMapper.countUserList(param);
    }

    @Override
    public void deleteUserById(String ids) {
        userMapper.deleteUserById(ids);
    }

    @Override
    public void updateUserRoleById(List<String> ids, String user_id) {
        userMapper.updateUserRoleById(ids,user_id);
    }

    @Override
    public void deleteUserRoleById(String id) {
        userMapper.deleteUserRoleById(id);
    }

}
